import crcmod

Crc16_Cal_Fun = crcmod.mkCrcFun(0x18005, rev=True, initCrc=0xFFFF, xorOut=0x0000)


def show_hex(val, header=""):
    if header:
        print(header, "---------")

    cnt = 0
    for i in val:
        print(f"{i:02X}", end=" ")
        cnt += 1
        if cnt % 16 == 0:
            print("--")
    print("")
